home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / UNIXTOOL / UNIXLIB37B / !UnixLib37_develop_sys_c_errlist < prev    next >
Encoding:
Text File  |  1996-11-09  |  5.4 KB  |  151 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/sys/c/RCS/errlist,v $
  4.  * $Date: 1996/10/30 21:59:00 $
  5.  * $Revision: 1.3 $
  6.  * $State: Exp $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: errlist,v $
  10.  * Revision 1.3  1996/10/30 21:59:00  unixlib
  11.  * Massive changes made by Nick Burret and Peter Burwood.
  12.  *
  13.  * Revision 1.2  1996/09/16 21:23:52  unixlib
  14.  * CL_0002 Nick Burret
  15.  * Minor changes to file handling
  16.  * Change most error numbers, and use in assembler sources (SJC)
  17.  * Various minor bug fixes and compatability changes.
  18.  *
  19.  * Revision 1.1  1996/04/19 21:34:24  simon
  20.  * Initial revision
  21.  *
  22.  ***************************************************************************/
  23.  
  24. static const char rcs_id[] = "$Id: errlist,v 1.3 1996/10/30 21:59:00 unixlib Exp $";
  25.  
  26. #include <string.h>
  27. #include <errno.h>
  28.  
  29. int sys_nerr = __SYS_NERR + 1;
  30.  
  31. char *sys_errlist[__SYS_NERR + 1] =
  32. {
  33.   "Error 0",
  34.   "Operation not permitted",                     /* EPERM */
  35.   "No such file or directory",             /* ENOENT */
  36.   "No such process",                  /* ESRCH */
  37.   "Interrupted system call",             /* EINTR */
  38.   "Input/output error",                 /* EIO */
  39.   "No such device or address",             /* ENXIO */
  40.   "Argument list too long",             /* E2BIG */
  41.   "Exec format error",                 /* ENOEXEC */
  42.   "Bad file descriptor",             /* EBADF */
  43.   "No child processes",                 /* ECHILD */
  44.   "Resource deadlock avoided",             /* EDEADLK */
  45.   "Cannot allocate memory",             /* ENOMEM */
  46.   "Permission denied",                 /* EACCES */
  47.   "Bad address",                 /* EFAULT */
  48.   "Block device required",             /* ENOTBLK */
  49.   "Device busy",                 /* EBUSY */
  50.   "File exists",                 /* EEXIST */
  51.   "Invalid cross-device link",             /* EXDEX */
  52.   "Operation not supported by device",         /* ENODEV */
  53.   "Not a directory",                       /* ENOTDIR */
  54.   "Is a directory",                 /* EISDIR */
  55.   "Invalid argument",                 /* EINVAL */
  56.   "Too many open files in system",         /* ENFILE */
  57.   "Too many open files",             /* EMFILE */
  58.   "Inappropriate ioctl for device",         /* ENOTTY */
  59.   "Text file busy",                        /* ETXTBSY */
  60.   "File too large",                 /* EFBIG */
  61.   "No space left on device",             /* ENOSPC */
  62.   "Illegal seek",                    /* ESPIPE */
  63.   "Read-only file system",             /* EROFS */
  64.   "Too many links",                 /* EMLINK */
  65.   "Broken pipe",                 /* EPIPE */
  66.   "Argument out of domain",             /* EDOM */
  67.   "Range error",                    /* ERANGE */
  68.   "Operation would block",             /* EWOULDBLOCK */
  69.   "Operation now in progress",             /* EINPROGRESS */
  70.   "Operation already in progress",         /* EALREADY */
  71.   "Socket operation on non-socket",         /* ENOTSOCK */
  72.   "Destination address required",         /* EDESTADDRREQ */
  73.   "Message too long",                   /* EMSGSIZE */
  74.   "Protocol wrong type for socket",         /* EPROTOTYPE */
  75.   "Option not supported by protocol",          /* ENOPROTOOPT */
  76.   "Protocol not supported",             /* EPROTONOSUPPORT */
  77.   "Socket type not supported",             /* ESOCKTNOSUPPORT */
  78.   "Operation not suppoted",             /* EOPNOTSUPP */
  79.   "Protocol family not supported",         /* EPFNOSUPPORT */
  80.   "Address family not supported by protocol family", /* EAFNOSUPPORT */
  81.   "Address already in use",                    /* EADDRINUSE */
  82.   "Can't assign requested address",         /* EADDRNOTAVAIL */
  83.   "Network is down",                   /* ENETDOWN */
  84.   "Network unreachable",             /* ENETUNREACH */
  85.   "Network dropped connection on reset",     /* ENETRESET */
  86.   "Software caused connection abort",         /* ECONNABORTED */
  87.   "Connection reset by peer",              /* ECONNRESET */
  88.   "No buffer space available",             /* ENOBUFS */
  89.   "Socket is already connected",         /* EISCONN */
  90.   "Socket is not connected",             /* ENOTCONN */
  91.   "Can't send after socket shutdown",         /* ESHUTDOWN */
  92.   "Too many references: can't splice",         /* ETOOMANYREFS */
  93.   "Connection timed out",                  /* ETIMEDOUT */
  94.   "Connection refused",                 /* ECONNREFUSED */
  95.   "Too many levels of symbolic links",         /* ELOOP */
  96.   "File name too long",                        /* ENAMETOOLONG */
  97.   "Host is down",                 /* EHOSTDOWN */
  98.   "Host unreachable",                 /* EHOSTUNREACH */
  99.   "Directory not empty",             /* ENOTEMPTY */
  100.   "Too many processes",                 /* EPROCLIM */
  101.   "Too many users",                 /* EUSERS */
  102.   "Disc quota exceeded",             /* EDQUOT */
  103.   "Stale NFS file handle",             /* ESTALE */
  104.   "Too many levels of remote in path",         /* EREMOTE */
  105.   "RPC struct is bad",                      /* EBADRPC */
  106.   "RPC version wrong",                 /* ERPCMISMATCH */
  107.   "RPC program not available",             /* EPROGUNAVAIL */
  108.   "RPC program version wrong",             /* EPROGMISMATCH */
  109.   "RPC bad procedure for program",         /* EPROCUNAVAIL */
  110.   "No locks available",                  /* ENOLCK */
  111.   "Function not implemented",             /* ENOSYS */
  112.   "Inappropriate file type or format",         /* EFTYPE */
  113.   "Authentication error",                  /* EAUTH */
  114.   "Need authenticator",                 /* ENEEDAUTH */
  115.   "Resource temporarily unavailable",         /* EAGAIN */
  116.   "", /* 83 */
  117.   "", /* 84 */
  118.   "", /* 85 */
  119.   "", /* 86 */
  120.   "", /* 87 */
  121.   "", /* 88 */
  122.   "", /* 89 */
  123.   "", /* 90 */
  124.   "", /* 91 */
  125.   "", /* 92 */
  126.   "", /* 93 */
  127.   "", /* 94 */
  128.   "", /* 95 */
  129.   "", /* 96 */
  130.   "", /* 97 */
  131.   "", /* 98 */
  132.   "", /* 99 */
  133.   "Inappropriate operation for background process", /* EBACKGROUND */
  134.   "Translator died",                              /* EDIED */
  135.   "?",                                  /* ED */
  136.   "A pretty bad error",                    /* EGREGIOUS */
  137.   "?",                                /* EIEIO */
  138.   "Gratuitous error",                    /* EGRATUITOUS */
  139.   "RISC OS error",                    /* EOPSYS */
  140.   "Signal Received"        /* as flagged by SIG_ERR */
  141. };
  142.  
  143. char *
  144. strerror (register int e)
  145. {
  146.   if (e < 0 || e >= sys_nerr)
  147.     return (0);
  148.  
  149.   return (sys_errlist[e]);
  150. }
  151.